package com.learning.jquizenglish.model;

import java.util.ArrayList;

public class QuestionModel {

	public String id;
	public String title;
	public String content;
	public String types_id;
	public String level_id;
	public String type_quiz;
	public String audio;
	public String date_created;
	public String date_updated;
	public String level_title;
	public String type_title;
	public ArrayList<AnswerModel> answers;
	public ArrayList<CommentModel> comments;
	public boolean isWaitingHide = false;
	public boolean isHide = false;
	public boolean isAnswered;
	public String answerId = "0";
	
	public boolean isCorrectAnswer(){
		int answersSize = answers.size();
		for (int i = 0; i < answersSize; i++) {
			if (answers.get(i).id.equals(answerId)) {
				if (answers.get(i).is_correct.equals("1")) {
					return true;
				}else{
					return false;
				}
			}
		}
		return false;
	}
}
